#include "diasettings.h"
#include "ui_diasettings.h"

DiaSettings::DiaSettings(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DiaSettings)
{
    ui->setupUi(this);
    this->ui->tabWidget->setCurrentIndex(0);
}

DiaSettings::~DiaSettings()
{
    delete ui;
}

void DiaSettings::setLogonPlugin(const QString &str){
    this->ui->le_logon->setText(str);
}

QString DiaSettings::getLogonPlugin(){
    return this->ui->le_logon->text();
}

void DiaSettings::setConnectHost(const QString &str){
    this->ui->le_connectHost->setText(str);
}

QString DiaSettings::getConnectHost(){
    return this->ui->le_connectHost->text();
}

void DiaSettings::setConnectPort(int port){
    this->ui->sb_connectPost->setValue(port);
}

int DiaSettings::getConnectPort(){
    return this->ui->sb_connectPost->value();
}

void DiaSettings::setConnectDirect(bool dir){
    if(dir){
        this->ui->cb_connectDirect->setCheckState(Qt::Checked);
    }else{
        this->ui->cb_connectDirect->setCheckState(Qt::Unchecked);
    }
}

bool DiaSettings::getConnectDirect(){
    return this->ui->cb_connectDirect->isChecked();
}
